#!/bin/bash
path1=`pwd`
program1=`ls $path1|grep 'jar'|awk -F'-' '{print $1}'`         #项目名称
programjar=`ls |grep 'jar'`                             #包名
programpid=`ps aux |grep java |grep ${programjar} |awk -F' ' '{print $2}'`    #上一个进程pid
if [ $programpid != '' ];then
    kill -9 ${programpid}
    echo "kill ${programpid}"
fi
/usr/local/jdk1.8.0_111/bin/java -jar ${programjar} > /dev/null 2>&1 &
